<template>
  <div>
    <el-card
      v-for="(item, index) in data"
      :key="index"
      class="item"
      :body-style="{'padding': '5px'}"
    >
      <div class="content">
        <div class="header">
          投票名称 {{ item.title }}
        </div>

        <div>
          请您投票
          <!-- 投票 Hash : {{ item.hashcode }} -->
        </div>
      </div>
      <div class="time">
        创建时间: {{ item.createTime }}
      </div>
    </el-card>
  </div>
</template>

<script>
export default {
  data() {
    return {
      data: [],
    };
  },
  methods: {
    getUserVoteAll() {
      this.$store.dispatch("userVote/hashMessage").then((res) => {
        this.data = res;
      });
    },
  },
  created() {
    this.getUserVoteAll();
  },
};
</script>

<style scoped>
.item {
  color: #5f5f5f;
  margin: 10px;
  padding: 0;
}

.header {
  font-size: 16px;
  margin-right: 40px;
}

.time {
  font-size: 10px;
}

.content {
  display: flex;
  justify-content: start;
  margin: 10px 0;
  font-weight: 600;
}
</style>